package com.yss.sofa.report.engine.util;

import java.io.FileInputStream;
import java.util.Properties;

import org.apache.commons.io.IOUtils;

public class ParamtersConfig {

    private Properties prop = new Properties();

    private ParamtersConfig() {
        initialize();
    }

    private void initialize() {
        FileInputStream fis = null;
        String path = SOFAEnvionmentUtil.getSOFAHomePath() + "/global/parameters.ini";
        try {
            fis = new FileInputStream(path);
            prop.load(fis);
        } catch (Exception e) {
            IOUtils.closeQuietly(fis);
        }
    }

    public static ParamtersConfig getInstance() {
        return new ParamtersConfig();
    }

    public String getParameter(String name) {
        return prop.getProperty(name);
    }
}
